/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.depaul.se.courseregistration.webservice;

import edu.depaul.se.courseregistration.jpa.schedule.CourseBeingTaught;
import edu.depaul.se.courseregistration.jpa.user.Student;
import edu.depaul.se.courseregistration.sessionbean.ProfessorSession;
import java.util.List;
import javax.ejb.EJB;
import javax.jws.WebService;
import javax.ejb.Stateless;
import javax.jws.Oneway;
import javax.jws.WebMethod;
import javax.jws.WebParam;

/**
 *
 * @author gabkh01
 */
//@WebService(serviceName = "ProfessorService")
@Stateless()
public class ProfessorService {
    @EJB
    private ProfessorSession ejbRef;
    @WebMethod(operationName = "signUpForClass")
    public int signUpForClass(@WebParam(name = "sectionId") int sectionId, @WebParam(name = "personId") int personId) {
        return ejbRef.signUpForClass(sectionId, personId);
    }

    @WebMethod(operationName = "unSignCourse")
    @Oneway
    public void unSignCourse(@WebParam(name = "sectionId") int sectionId, @WebParam(name = "personId") int personId) {
        ejbRef.unSignCourse(sectionId, personId);
    }

    @WebMethod(operationName = "updateGrade")
    @Oneway
    public void updateGrade(@WebParam(name = "sectionId") int sectionId, @WebParam(name = "personId") int personId, @WebParam(name = "grade") String grade) {
        ejbRef.updateGrade(sectionId, personId, grade);
    }

    @WebMethod(operationName = "getStudentList")
    public List<Student> getStudentList(@WebParam(name = "sectionId") int sectionId) {
        return ejbRef.getStudentList(sectionId);
    }

    @WebMethod(operationName = "getSchedule")
    public List<CourseBeingTaught> getSchedule(@WebParam(name = "personId") int personId) {
        return ejbRef.getSchedule(personId);
    }
    
}
